<%@page import="com.lihongman.dao.DaoyouDao"%>
<%@page import="com.lihongman.entity.Message"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>信息列表</title>
    <link href="style/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.js"></script>
	 <script src="js/jquery.js"></script>
    <script src="js/google-code-prettify/prettify.js"></script>
    <script src="js/bootstrap-transition.js"></script>
    <script src="js/bootstrap-alert.js"></script>
	<script src="js/bootstrap-dropdown.js"></script>
    <script src="js/bootstrap-modal.js"></script>
 
    


	
	
	<style type="text/css">
		#caozuo .choose {
			position: relative;
		}
		#caozuo .xuanxiang{
			position:absolute;
			right:20px;
		}
		#caozuo a{
			margin: 25px;
		}
		#biaodan {
			margin-top:120px;
			width:85%;
			margin-left:auto;
			margin-right:auto;
		}
		i{
			margin:5px;
		}
		#dibu{
			margin-left:50px;
			margin-top:100px;
			}
		#dibu span{
			font-size: 16px
		}
	</style>
  </head>
  
  <body>
  
  
  
    <div class="navbar">
		<div class="navbar-inner">
			<div class="container" style="width: auto;">
				<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
				<a class="brand" href="#">品竹缘健康生活馆</a>
				<div class="nav-collapse">
				<ul class="nav">
					<li class="active">
						<a href="#">首页</a>
					</li>
					<li>
						<a href="#">用户管理</a>
					</li>
				</ul>
				<ul class="nav pull-right">
					<li class="divider-vertical"></li>
					<li>
						<a href="#">admin</a>
					</li>
				</ul>
				</div>
			</div>
		</div>
	</div>
	
	

	<div id="myModal" class="modal hide fade" style="display: none;" >
		<div class="modal-header" >
			<a class="close" data-dismiss="modal">×</a>
				<h3>自定义搜索</h3>
		</div>
		<form class="form-horizontal"  action="message.html?task=sousuo" method="post">
			<div class="modal-body">
				<div class="control-group">
					<label class="control-label" for="input01">单位</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="company" style="height:26px">
						</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">导游</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="daoyou" style="height:26px">
						</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">客源地</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="source" style="height:26px">
						</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">开始日期</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="starttime" style="height:26px">
						</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">结束日期</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="endtime" style="height:26px">
						</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">最低销售额</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="minmoney" style="height:26px">
						</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="input01">最高销售额</label>
						<div class="controls">
							<input id="input01" class="input-xlarge" type="text" name="maxmoney" style="height:26px">
						</div>
				</div>
			</div>
			<div class="modal-footer">
				<a class="btn" href="message.html">取消</a>
				<input type="submit" class="btn btn-primary" href="#" value="确定"/>
			</div>
		</form>
	</div>
	
	<div id="modal" class="modal hide fade" style="display: none;">
		<div class="modal-header">
			<a class="close" data-dismiss="modal" href="#">×</a>
			<h3>删除提示</h3>
		</div>
			<div class="modal-body">
				<p>确定删除？</p>
		</div>
		<div class="modal-footer">
			<a class="btn btn-primary" href="javascript:void(0)" onClick="delMessage()">删除</a>
			<a class="btn" href="message.html">取消</a>
		</div>
	</div>
	<div id="caozuo">
	<div class = "choose" >
		<div class = "xuanxiang" >
			<a href="message.html" class="btn btn-success btn-large"><i class="icon-home"></i>所有记录</a>
			<a href="message.html?task=add" class="btn btn-primary btn-large"><i class="icon-edit"></i>添加记录</a>
			<a class="btn btn-info btn-large" href="#myModal" data-toggle="modal"><i class="icon-search"></i>搜索记录</a>
			<a href="message.html?task=excel" class="btn btn-large"><i class="icon-share-alt"></i>导出为Excel</a>
		</div>
	</div>
	</div>
	<div id="biaodan">
		<table class="table">
			<thead>
				<tr>
					<th>时间</th>
					<th>单位</th>
					<th>导游</th>
					<th>客源地</th>
					<th>人数</th>
					<th>销售额</th>
					<th>客单价</th>
					<th></th>
					
				</tr>
			</thead>
			<tbody>
				<%
					List<Message> messageList = (List<Message>)session.getAttribute("list");
					for(Message message : messageList){
						
				%>
				<tr>
					<td><%=message.getTime()%></td>
					<td><%=message.getCompany().getCompany()%></td>
					<td><%=message.getDaoyou().getName()%></td>
					<td><%=message.getSource()%></td>
					<td><%=message.getRenshu()%></td>
					<td><%=message.getMoney()%></td>
					<td><%=message.getDanjia()%></td>
					<td>
						<a href="message.html?task=edit&id=<%=message.getId()%>"><i class="icon-plus-sign"></i>修改</a>&nbsp;&nbsp;
						<a rel="message.html?task=del&id=<%=message.getId() %>" class="delet" href="#modal" data-toggle="modal" ><i class="icon-trash"></i>删除</a>
					</td>
				</tr>
				<%}%>
			</tbody>
		</table>
	</div>
	<div id="dibu">
		<span>@凯盛软件</span>
	</div>
	<script type="text/javascript">
		var rel;
		$(".delet").click(function(){
			rel = $(this).attr("rel");
		});
		function delMessage(){
			var url = rel;
			window.location.href = url;
			
		};
	</script>
  </body>
</html>
